var app = getApp()


//获取评论
function requestCommment(data,callback) {
  app.func.Get(true,app.api.comment_all, data, function (res) {
    console.log("0---------------- 0", res);
    typeof callback == "function" && callback(res)
  })
};

//新增评论
function addComment(params,callback) {
  app.func.Post(true,app.api.comment_add, params, function (res) {
    console.log("0---------------- 0", res);
    typeof callback == "function" && callback(res.code);
  });
};  
//删除评论
function deleteComment(id,callback){
  let data = {
    'id': id
  }
  app.func.Post(true,app.api.comment_del, data, function (res) {
    console.log("0---------------- 0", res);
    typeof callback == "function" && callback(res.code)
  })
};

module.exports = {
  requestCommment: requestCommment,
  addComment: addComment,
  deleteComment: deleteComment,

};